package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * PROJECT_NAME: sky-take-out
 * NAME: SetmealDishMapper
 *
 * @AUTHOR: zhang
 * DATE: 2023/11/24
 * DESCRIPTION :
 */
@Mapper
public interface SetmealDishMapper {
    /**
     * 根据菜品id查看套餐菜品关联信息
     * @param dishId
     * @return
     */
    List<SetmealDish> selectSetmealDishByDishId(@Param("dishId") Long dishId);

    /**
     * 添加套菜菜品关系表
     * @param setmealDishList
     */
    void insertSetmealDish(@Param("setmealDishList") List<SetmealDish> setmealDishList,@Param("setmealId") Long setmealId);

    /**
     * 批量删除套餐关联的菜品
     * @param ids
     */
    void batchDeleteSetmealDish(@Param("ids") List<Long> ids);

    /**
     * 根据套餐id查询套餐菜品关联信息
     * @param setmealId
     * @return
     */
    List<SetmealDish> selectSetmealDishBySetmealId(@Param("setmealId") Long setmealId);

    /**
     * 根据套餐id删除套餐关联的菜品
     * @param setmealId
     */
    void deleteSetmealDishBySetmealId(@Param("setmealId") Long setmealId);
}
